- /* slomuldb.cpp by K.Tsuru */
- // function ID = 227 DRADIX
- /****************************************************************************
- SLong class
- operator SLong(m)*double(n)
- The decimals of n is omitted. It includes the operator with int, long etc.
- If only the operator SLong*long is provided a statement
- b = a*1.234567890123456789e300;
- calls that one.It is necessary to provide the operator SLong*double.
- About the other operators SLong*long, SLong*int etc they must have similar process.
- Then a faster speed cannot be expected moreover the size of code increases.
- To obtain a fast speed it is desirable to use LsMult() or LsDiv() which is
- about 25% faster.
- ****************************************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SLong operator*(const SLong& m, double n){
- if(n == 1.0) return m;
- if(n == -1.0) return -m;
- if(fabs(n) < 1.0) return SLong(m.Type(), minArraySize);
- if(m.Sign(227)==0) return m;
-
- SLong r;
- if(fabs(n) <= (double)m.SlOpMaxValue() ){
- ulong p = (ulong)fabs(n);
- r = LsMult(m, p);
- if(n < 0) r.ChangeSign();
- } else {
- r = n;
- r = LLMult(m, r);
- }
- return r;
- }
slomuldb.cpp : last modifiled at 2015/11/27 14:24:35(1,179 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).